﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using VehicleMaintenance.Comm;

namespace VehicleMaintenance.Models
{
    public class CarInfo
    {
        [Key]
        public int CarID { get; set; }

        [Display(Name = "车牌号")]
        [Required(ErrorMessage = "车牌号不能为空")]
        public string NO { get; set; }

        //[ForeignKey("CustomerID")]
        [Column("CustomerID")]
        [Required(ErrorMessage = "车主不能为空")]
        [Display(Name = "车主")]
        public int CustomerID { get; set; }

        //[ForeignKey("CarTypeID")]
        [Display(Name = "车型")]
        [Required(ErrorMessage = "车型不能为空")]
        public int CarTypeID { get; set; }

        [Display(Name = "车名")]
        [Required(ErrorMessage = "车名不能为空")]
        public string CarName { get; set; }

        [Display(Name = "发动机号")]
        public string Engine { get; set; }

        [Display(Name = "底盘号")]
        public string Chassis { get; set; }

        [Display(Name = "单位")]
        public string UnitName { get; set; }

        [Display(Name = "行驶里程")]
        public int Mileage { get; set; }

        [Display(Name = "颜色")]
        public string Color { get; set; }

        [Display(Name = "出厂编号")]
        public string SerialNumber { get; set; }

        [Display(Name = "出厂日期")]
        [ControlTypeAttribute(Type = "DateTimePicker")]
        public string ReleaseDate { get; set; }

        [Display(Name = "购买日期")]
        [ControlTypeAttribute(Type = "DateTimePicker")]
        public string DateOfPurchase { get; set; }

        [Display(Name = "购买价格/万")]
        public decimal Price { get; set; }

        [Display(Name = "一保日期")]
        [ControlTypeAttribute(Type = "DateTimePicker")]
        public string WarrantyDate1 { get; set; }

        [Display(Name = "二保日期")]
        [ControlTypeAttribute(Type = "DateTimePicker")]
        public string WarrantyDate2 { get; set; }

        [Display(Name = "备注")]
        public string Remark { get; set; }

        public Customer Customer { get; set; }

        public CarType CarType { get; set; }

        public List<MainBill> MainBill { get; set; }
    }
}
